﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace Jackie.Update.ServiceContracts
{
    [ServiceContract]
    public interface IFileUpDownload
    {
        /// <summary>
        /// 分片从服务器读取文件
        /// </summary>
        /// <param name="filePath">服务器中的文件路径</param>
        /// <param name="length">读取长度</param>
        /// <param name="offset">相对于文件开始的偏移量</param>
        /// <returns></returns>
        [OperationContract]
        byte[] Download(string filePath, int length, long offset);

        /// <summary>
        /// 分片上传文件到服务器
        /// </summary>
        /// <param name="filePath">服务器中的文件路径</param>
        /// <param name="buffer">文件片</param>
        /// <param name="offset">相对于文件开始的偏移量</param>
        [OperationContract]
        void Upload(string filePath, byte[] buffer, long offset);
    }
}
